package cn.com.dcsgo.validation;

import cn.com.dcsgo.validation.validator.NotBlankIfNotNullValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.*;

/**
 * 当字段不为null时校验其不为空白字符串
 *
 * @author Dcsgo
 * @since 2025/10/1 10:33
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = NotBlankIfNotNullValidator.class)
public @interface NotBlankIfNotNull {
    String message() default "字段不为null时，不能是空白字符串";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
